package com.inspur.his.controller;

import com.inspur.his.common.EncrypDES;
import com.inspur.his.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.HashMap;

@Controller
public class UserController {
    @Autowired
    UserService userService;

    @RequestMapping("updatepdwContrller")
    public String updatepwd(String id, String username, String password2) throws Exception {
        HashMap map =  new HashMap();
        map.put("id",id);
        String key = "2020@#$2020";
        EncrypDES des = new EncrypDES(key);
        String en_pass = des.encrypt(password2);//加密后的密码
        map.put("password",en_pass);
        map.put("password",en_pass);
        userService.updatePwd(map);
        return "login.jsp";
    }



}
